﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="comfirm.ascx.cs" Inherits="WebClient.clientCtrls.comfirm" %>
<script language="javascript">
    function sameto() {
        var txtMy = "ctl00_ContentPlaceHolder1_comfirm1_";
        var z = "z";
        var ArrField = new Array("fullname", "email", "dienthoai", "fax", "diachi");
        var l = ArrField.length;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(txtMy + ArrField[i]);
            var val  = document.getElementById(txtMy + ArrField[i] + z);            
            val.value = myVal.value;
        }
    }

    function hideAll(scontrol) {
        var l = scontrol.length;
        var Err = "Err";
        for (var i = 0; i < l; i++) {
            var obj = document.getElementById(Err + ArrField[i]);
            obj.style.display = 'none';
        }
    }

    function isCheck() {
        var txtMy = "ctl00_ContentPlaceHolder1_comfirm1_";
        var z = "z";
        var ArrField = new Array("fullname", "email", "dienthoai", "diachi");
        hideAll(ArrField);
        var l = ArrField.length;
        var errExisting = true;
        var Err = "Err";
        var Errfocus = false;
        for (var i = 0; i < l; i++) {
            var val = document.getElementById(txtMy + ArrField[i] + z);
            if (val.value === "" || val.value === null) {
                errExisting = false;
                var obj = document.getElementById(Err + ArrField[i]);
                obj.style.display = 'block';
                if (!errExisting && !Errfocus) {
                    val.focus();
                    Errfocus = true;
                }
            }
        }
        return false;
    }
</script>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
  <tbody><tr>
    <td width="47%" valign="top"><strong>
      Thông tin người mua hàng      </strong><br>
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="145">
		  <tbody><tr>
			<td width="25%" height="22">Họ và Tên</td>
			<td width="1%" height="22">:</td>
			<td width="51%" height="22">
			  <asp:TextBox  ID="fullname" Text="Pham van hai" runat="server" style="width:100%" size="20" ></asp:TextBox>
                
              </td>
		  </tr>
		  <tr>
			<td width="25%" height="22">Email</td>
			<td width="1%" height="22">:</td>
			<td width="74%" height="22">
			  <asp:TextBox  ID="email" Text="" runat="server" ReadOnly="true" style="width:100%" size="20"/></td>
		  </tr>
		  <tr>
			<td width="25%" height="22">Điện thoại</td>
			<td width="1%" height="22">:</td>
			<td width="74%" height="22">
			  <asp:TextBox  ID="dienthoai" Text="" runat="server" style="width:100%" size="20"/></td>
		  </tr>
		  <tr>
			<td width="25%" height="22">Fax</td>
			<td width="1%" height="22">:</td>
			<td width="74%" height="22">
			  <asp:TextBox  ID="fax" Text="" runat="server" style="width:100%" size="20"/></td>
		  </tr>
		  <tr>
			<td width="25%" height="19">Địa chỉ</td>
			<td width="1%" height="19">:</td>
			<td width="74%" height="19">
			  <asp:TextBox  ID="diachi" Text="" runat="server" style="width:100%" size="20"/></td>
		  </tr>
	
	
		</tbody></table> 
        </td>
    <td width="6%">&nbsp;</td>
    <td width="47%" valign="top"><strong>
      Thông tin người nhận hàng      </strong>
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="145">
          <tbody><tr>
            <td width="25%" height="22">Họ và Tên</td>
            <td width="1%" height="22">:</td>
            <td width="51%" height="22"><asp:TextBox runat="server" ID="fullnamez" Text="" style="width:100%" size="20"/>
            <span id="Errfullname" class="Err" style="display:none;">Err</span>
            </td>
          </tr>
          <tr>
            <td width="25%" height="22">Email</td>
            <td width="1%" height="22">:</td>
            <td width="74%" height="22"><asp:TextBox  ID="emailz" runat="server" Text="" style="width:100%" size="20"/>
            <span id="Erremail" class="Err" style="display:none;">Err</span>
            </td>
          </tr>
          <tr>
            <td width="25%" height="22">Điện thoại</td>
            <td width="1%" height="22">:</td>
            <td width="74%" height="22"><asp:TextBox  ID="dienthoaiz" Text="" runat="server" style="width:100%" size="20"/>
            <span id="Errdienthoai" class="Err" style="display:none;">Err!</span>
            </td>
          </tr>
          <tr>
            <td width="25%" height="22">Fax</td>
            <td width="1%" height="22">:</td>
            <td width="74%" height="22"><asp:TextBox runat="server"  ID="faxz" Text="" style="width:100%" size="20"/>
            </td>
          </tr>
          <tr>
            <td width="25%" height="19">Địa chỉ</td>
            <td width="1%" height="19">:</td>
            <td width="74%" height="19"><asp:TextBox  ID="diachiz" runat="server" Text="" style="width:100%" size="20"/>
                <span id="Errdiachi" class="Err" style="display:none;">Err</span>
            </td>
          </tr>
    <tr>
            <td width="25%" height="19">Số tài khoản</td>
            <td width="1%" height="19">:</td>
            <td width="74%" height="19"><asp:TextBox  ID="txtCard" runat="server" Text="" style="width:100%" size="20"/>
                <span id="Span1" class="Err" style="display:none;">Err</span>
            </td>
          </tr>
    
          </tr>
      </tbody></table></td>
  </tr>
</tbody></table>
<div align="center">
  <input type="checkbox" value="1" name="muanhan" id="muanhan_row_1" onclick="sameto()">
  <label for="muanhan_row_1">
  Click vào đây nếu người mua cũng chính là người nhận hàng!  </label>
</div>

<p>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
  <asp:GridView ID="grdDs" runat="server" Width="100%" BorderColor="Transparent" PageSize="25" 
                        AllowPaging="True" AutoGenerateColumns="False" CellPadding="0"  
                            DataKeyNames="id" BorderWidth="1px"
                            >                        
                        <Columns>                        
                          <asp:TemplateField HeaderText="STT" HeaderStyle-Width="20" HeaderStyle-HorizontalAlign="center"
                            HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1"
                            ItemStyle-HorizontalAlign="Center" ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid"
                            ItemStyle-BorderWidth="1" FooterStyle-BorderColor="Black" FooterStyle-BorderStyle="Solid"
                            FooterStyle-BorderWidth="1" >
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblSTT" Text='<%# Container.DataItemIndex + 1%>' />
                            </ItemTemplate>
                              <FooterStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                              <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                  HorizontalAlign="Center" Width="20px" />
                              <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                  HorizontalAlign="Center" />
                        </asp:TemplateField>

                     

                           <asp:TemplateField ItemStyle-CssClass="WordWrapItem" HeaderText="Tên sản phẩm" ItemStyle-VerticalAlign="Middle"  HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid"
                            HeaderStyle-BorderWidth="1" ItemStyle-HorizontalAlign="Left" ItemStyle-BorderColor="Black"
                            ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" FooterStyle-BorderColor="Black"
                            FooterStyle-BorderStyle="Solid" FooterStyle-BorderWidth="1">
                            <ItemTemplate>                               
                               <span style="font-weight:bold;"><%#Convert.ToString(DataBinder.Eval(Container.DataItem, "productName"))%>                                                                                                       
                               </span>
                            </ItemTemplate>
                               <FooterStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                   CssClass="WordWrapItem" HorizontalAlign="Left" VerticalAlign="Middle" />
                        </asp:TemplateField>  

                           

                           <asp:TemplateField HeaderText="SL" HeaderStyle-Width="20" HeaderStyle-HorizontalAlign="center"
                            HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid" HeaderStyle-BorderWidth="1"
                            ItemStyle-HorizontalAlign="Center" ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid"
                            ItemStyle-BorderWidth="1" FooterStyle-BorderColor="Black" FooterStyle-BorderStyle="Solid"
                            FooterStyle-BorderWidth="1" >
                            <ItemTemplate>                               
                               
                                 <span style="font-weight:bold;"><%#Convert.ToString(DataBinder.Eval(Container.DataItem, "soluong"))%>
                               </span>
                            </ItemTemplate>
                               <FooterStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                   HorizontalAlign="Left" Width="20px" />
                        </asp:TemplateField>  

                      
                      <asp:TemplateField ItemStyle-CssClass="WordWrapItem" HeaderText="Đơn giá" ItemStyle-VerticalAlign="Middle"  HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid"
                            HeaderStyle-BorderWidth="1" ItemStyle-HorizontalAlign="Left" ItemStyle-BorderColor="Black"
                            ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" FooterStyle-BorderColor="Black"
                            FooterStyle-BorderStyle="Solid" FooterStyle-BorderWidth="1">
                            <ItemTemplate>                               
                               <span style="font-weight:bold;"><%#Convert.ToString(DataBinder.Eval(Container.DataItem, "price"))%>
                               </span>
                            </ItemTemplate>
                               <FooterStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                   CssClass="WordWrapItem" HorizontalAlign="Left" VerticalAlign="Middle"  />
                        </asp:TemplateField>  
                        <asp:TemplateField ItemStyle-CssClass="WordWrapItem" HeaderText="Thành tiền" ItemStyle-VerticalAlign="Middle"  HeaderStyle-BorderColor="Black" HeaderStyle-BorderStyle="Solid"
                            HeaderStyle-BorderWidth="1" ItemStyle-HorizontalAlign="Left" ItemStyle-BorderColor="Black"
                            ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1" FooterStyle-BorderColor="Black"
                            FooterStyle-BorderStyle="Solid" FooterStyle-BorderWidth="1">
                            <ItemTemplate>                               
                               <span style="font-weight:bold;"><%#Convert.ToString(DataBinder.Eval(Container.DataItem, "thanhtien"))%>
                               </span>
                            </ItemTemplate>
                               <FooterStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                               <ItemStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                   CssClass="WordWrapItem" HorizontalAlign="Left" VerticalAlign="Middle" />
                        </asp:TemplateField>  


                        </Columns>

                        </asp:GridView>

</ContentTemplate>
    </asp:UpdatePanel>
</p>

<p>
<table width="100%">
		<tbody><tr>
		<td align="left">
		<div align="left">
		
		</div>		</td>
		<td align="right">
        <div align="right">
        <p align="right" class="MsoNormal"><font size="4" color="#FF0000"><b>Tổng cộng:  <asp:Literal ID="lblSum" runat="server"></asp:Literal> VNĐ</b></font></p>
		 </div>	
            	</td>
		</tr>
		</tbody></table>
</p>
<p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
  <tbody>
  <tr>
    <td width="230"><br>
      
      
      

	  </label></td>
    <td width="30">&nbsp;</td>
    <td>
    
    <p>
    <span style="FONT-SIZE: 12pt">Vui lòng xem lại các thông tin trên. Nếu đúng, nhấn nút 'Mua hàng'.</span></p>
    
        <asp:ImageButton ID="btnMuaHang"  runat="server" 
            ImageUrl="/images/btn-submit.gif" onclick="btnMuaHang_Click" /></td>
  </tr>
</tbody></table>
</p>


